<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo" cellspacing="1" style="table-layout:fixed;">
	<col width="15%;">
	<col width="20%;">
	<col width="10%;">
	<col width="20%;">
	<col width="15%;">
	<col width="20%;">
	<tr> 
		<td   colspan="6" class="t_bar2">基本情况</td>
	</tr>
	<tr>
		<td  align="right"  rowspan="3">候选人姓名或组织名称</td>
		<td  align="right" ><span class="color_red">*</span>母语：</td>
		<td colspan="3">
			<input name="proposal/mather_language" label="候选人姓名或组织名称-->母语" type="text"   class="input_css required " style="width: 300px;"  maxlength="80" value="<x:out select="$xmlData/data/proposal/mather_language" />"/> （限80个字符）
		</td>
		<td rowspan="3" align="center" >
		<c:set var="file_code8"><x:out select="$xmlData/data/content/file_code8" /></c:set>
		<div id="uploadsuccess8">
		<c:choose>
		<c:when test="${file_code8==''}">
			<img id="orgphotoImg" src="${param.res_app}/images/app/photo_01.jpg"  style="width:96px;height:125px" />
		 </c:when>
		<c:otherwise>
			 <img id="orgphotoImg" src="${ctx}/file/ajax-filedownload?fileCode=<x:out select="$xmlData/data/content/file_code8" />"  style="width:130px;height:159px" />
		</c:otherwise>
		</c:choose>
		<br/>
		<a href="#" style="cursor: pointer;" onclick="cilckFile('org')" id="aaa"><span style="color: blue;">[上传照片]</span></a><BR />
		</div>
		<div id="file8" style="text-align:center">
			   <input type="hidden" name="content/file_code8" id="content_file_code8"  label="照片" class="required " value="<x:out select="$xmlData/data/content/file_code8" />" />
		</div>
		 </td>	
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>中文：</td>
		<td colspan="3">
			<input name="proposal/tmp_title" id="tmp_title" label="候选人姓名或组织名称-->中文" type="text" onkeyup="setTitle();"  class="input_css required " style="width: 300px;" maxlength="40" value="<x:out select="$xmlData/data/proposal/tmp_title" />"/> （限40个汉字）
			<input type="hidden" id="zh_title" name="proposal/zh_title" value="" />
		</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>英文：</td>
		<td colspan="3">
			<input name="proposal/en_title" label="候选人姓名或组织名称-->英文" type="text"   class="input_css required " style="width: 300px;" maxlength="80" value="<x:out select="$xmlData/data/proposal/en_title" />"/> （限80个字符）
		</td>
	</tr>
	<tr>
		<td  align="right" >国籍：</td>
		<td  >
			<c:set var="region_value"><x:out select="$xmlData/data/proposal/region_value" /></c:set>
			<cpt:select id="region"  key="country"  value="${region_value}" onChange="initControlValue(this.id);" style="width:78%;"></cpt:select>
			<input type="hidden" id="region_value" name="proposal/region_value" class="" value="${region_value}" label="国籍">
			<input type="hidden" name="proposal/region_name" value="<x:out select="$xmlData/data/proposal/region_name" />">
		</td>
		<td  align="right" >性别：</td>
		<td  >
			<c:set var="gender_value"><x:out select="$xmlData/data/proposal/gender_value" /></c:set>
			<cpt:select id="gender"  key="gender"  value="${gender_value}" onChange="initControlValue(this.id);" style="width:83%;"></cpt:select>
			<input type="hidden" id="gender_value" name="proposal/gender_value" class="" value="${gender_value}" label="性别">
			<input type="hidden" name="proposal/gender_name" value="<x:out select="$xmlData/data/proposal/gender_name" />"> 
		</td>
		<td  align="right" >出生年月：</td>
		<td  >
			<c:set var="birthday"><x:out select="$xmlData/data/proposal/birthday" /></c:set>
			<cpt:date id="birthday" name="proposal/birthday" className=" date" label="出生年月"  value="${birthday}" ></cpt:date> 
		</td>
	</tr>
	<tr>
		<td  align="right" >行政职务：</td>
		<td  >
			<input name="proposal/position" label="行政职务" type="text"   class="input_css  "  maxlength="60" value="<x:out select="$xmlData/data/proposal/position" />"/> 
		</td>
		<td  align="right" >职称：</td>
		<td  >
			<c:set var="proftitlevalue">{'id':'<x:out select='$xmlData/data/proposal/prof_title_value' />','name':'<x:out select='$xmlData/data/proposal/prof_title_name' />'}</c:set>
			<cpt:tree key="prof_title" cacheable="false" readonly="true" value="${proftitlevalue }" id="prof_title" name="prof_title"  showPattern="all" shieldPattern="-1" onClick="initTreeValueExt"   label="职称" />
			<input type="hidden" id="prof_title_value" name="proposal/prof_title_value" value="<x:out select='$xmlData/data/proposal/prof_title_value' />" class=""  label="职称"/> 
			<input type="hidden" id="prof_title_name" name="proposal/prof_title_name" value="<x:out select='$xmlData/data/proposal/prof_title_name' />" />
		</td>
		<td  align="right" >学位：</td>
		<td  >
			<c:set var="degree_value"><x:out select="$xmlData/data/proposal/degree_value" /></c:set>
			<cpt:select id="degree" key="degree" name="degree" onChange="initControlValue(this.id);" value="${degree_value }" style="width: 85%;"></cpt:select>
         <input type="hidden" name="proposal/degree_value" class="" label="学位" value="<x:out select="$xmlData/data/proposal/degree_value" />"/>
         <input type="hidden" name="proposal/degree_name" value="<x:out select="$xmlData/data/proposal/degree_name" />"/>
		</td>
	</tr>
	<tr>
		<td  align="right" >专业、专长：</td>
		<td colspan="5">
			<input name="proposal/speciality" label="专业、专长“ type="text"   class="input_css  " style="width: 350px;" maxlength="70" value="<x:out select="$xmlData/data/proposal/speciality" />"/> （限70个汉字）
		</td>
	</tr>
	<tr>
		<td rowspan="2" align="center">工作单位</td>
		<td  align="right" ><span class="color_red">*</span>中文：</td>
		<td colspan="4">
			<input name="proposal/zh_orgname" label="工作单位-->中文" type="text"   class="input_css required " style="width: 350px;" maxlength="60" value="<x:out select="$xmlData/data/proposal/zh_orgname" />"/> （限60个汉字）
		</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>英文：</td>
		<td colspan="4">
			<input name="proposal/en_orgname" label="工作单位-->英文" type="text"   class="input_css required " style="width: 350px;" maxlength="120" value="<x:out select="$xmlData/data/proposal/en_orgname" />"/> （限120个字符）
		</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>通讯地址：</td>
		<td colspan="3">
			<input name="proposal/contact_address" label="通讯地址" type="text"   class="input_css required " style="width: 350px;" maxlength="40" value="<x:out select="$xmlData/data/proposal/contact_address" />"/> （限40个汉字）
		</td>
		<td  align="right" ><span class="color_red">*</span>邮编：</td>
		<td colspan="3">
			<input name="proposal/zip_code" label="邮编" type="text"  class="hn_iuput_kuang required"    maxlength="6" value="<x:out select="$xmlData/data/proposal/zip_code" />"/>
		</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>联系电话：</td>
		<td colspan="3">
			<input name="proposal/contact_tel" label="联系电话" type="text"   class="input_css required " style="width: 350px;" maxlength="40" value="<x:out select="$xmlData/data/proposal/contact_tel" />"/>
		</td>
		<td  align="right" ><span class="color_red">*</span>传真：</td>
		<td colspan="3">
			<input name="proposal/fax" label="传真" type="text"   class="input_css required "  maxlength="40" value="<x:out select="$xmlData/data/proposal/fax" />"/>
		</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>电子信箱：</td>
		<td colspan="5">
			<input name="proposal/email" label="电子信箱"  type="text"   class="input_css required email" style="width: 450px;" maxlength="60" value="<x:out select="$xmlData/data/proposal/email" />"/> （限60个汉字）
		</td>
	</tr>
	<tr>
		<td  align="right" nowrap><span class="color_red">*</span>与国内合作的有关单位：</td>
		<td colspan="5">
			<input name="proposal/attend_org" label="与国内合作的有关单位"  type="text"   class="input_css required " style="width: 450px;" maxlength="60" value="<x:out select="$xmlData/data/proposal/attend_org" />"/> （限60个汉字）
		</td>
	</tr>
	<tr>
	   <td  align="right" nowrap><span class="color_red">*</span>与国内合作的起止时间：</td>
		<td  colspan="2">起始：
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date  dateCompare:end_date" label="与国内合作的起始时间" ></cpt:date> 
		</td>
		<td colspan="3">完成：
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className=" required date" label="与国内合作的完成时间"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
<%-- 	<tr>
		<td align="right"><span class="color_red">*</span>归口管理部门：</td>
		<td colspan="5">
			<c:set var="recomend_org"><x:out select="$xmlData/data/proposal/recomend_org_value" /></c:set>
			<c:set var="sqOrgCode"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/></c:set>
			<cpt:select id="recomend_org"    key="proposal_tjbm"  value="${recomend_org}" onChange="initControlValue(this.id);" style="width:300px;"></cpt:select>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="${recomend_org}" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr> --%>
	<tr>
		<td align="right" colspan="1"><span class="color_red">*</span>推荐单位：</td>
		<td colspan="5">
		<c:set var="recomend_org">
		{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
		'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'
		}					
		</c:set> <cpt:tree id="recomend_org" key="recommended"
				cacheable="false" className="hn_iuput_kuang required selectWidth3"
				readonly="true" value="${recomend_org}" label="推荐单位"
				showPattern="all" shieldPattern="0"
				onClick="initTreeValue2">
			</cpt:tree> <input type="hidden" name="proposal/recomend_org_value"
			value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" />
			<input type="hidden" name="proposal/recomend_org_name"
			value="<x:out select="$xmlData/data/proposal/recomend_org_name" />" />
		</td>
	</tr>

</table>


<script type="text/javascript">
$(function(){
	
});

function cilckFile(flag){
	var fileCode = $('#content_file_code8').val();
	if(fileCode!=""){
		tb_show("上传照片", "<c:out value="${ctx}"/>/proposal/edit/dialog/updatePhoto?fileCode="+fileCode+"&flag="+flag+"&TB_iframe=true&height=250&width=530", false);
	}else{
		
		tb_show("上传照片", "<c:out value="${ctx}"/>/proposal/edit/dialog/updatePhoto?flag="+flag+"&TB_iframe=true&height=250&width=530", false);
	}
}


function percentage(id1,id2,id3){
	var val1 = $("#"+id1).val();
	var val2 = $("#"+id2).val();
	$("#"+id3).text(formatVal(val2*100/val1)+"%");
	
}

function setTitle(){
	var tmp_title = $("#tmp_title").val();
	$('#zh_title').val(tmp_title+'国际科学技术合作荣誉奖');
}


function initTreeValueExt(treeId, treeNode) {
	   
	  if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
		}
		
		return false;
		}
	
	
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}
		
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
		
	}

</script>

